<template>
<div class="page">
    <!-- 大首页 -->
    <template v-if="type=='index'">
        <index></index>
    </template>
    <!-- 民宿首页 -->
    <template v-if="type=='hotel'">
        <hotel-index></hotel-index>
    </template>
    <!-- 商家管理员 -->
    <template v-if="type=='buisness'">
        <hotelbuisness></hotelbuisness>
    </template>
    <!-- 商户管理个人 -->
    <template v-if="type=='buisnessInfo'">
      <hotelbuisness2></hotelbuisness2>
    </template>
</div>
</template>

<script>
import * as echarts from "echarts";
import index from "./homePage"
import hotelIndex from "./companyCenter/index"
import hotelbuisness from "./homebusiness"
import hotelbuisness2 from "./homebusinessPerson"
export default {
    name: "",
    data() {
        return {
            type: ''
        }
    },
    components: {
        index,
        hotelbuisness2,
        hotelbuisness,
        hotelIndex
    },
    mounted() {
        if (this.$store.state.user.superAdmin == 1) {
            this.type = "index"
        } else {
            if (this.$store.state.user.type == '1') { //酒店民宿
                this.type = "hotel"
            } else if (this.$store.state.user.type == '2') { //商家
                if(this.$store.state.user.roleList&&this.$store.state.user.roleList.indexOf('1743510179346911234')>-1){
                    this.type = "buisness"
                }else{
                     this.type = "buisnessInfo"
                }
            } else {
                this.type = 'index'
            }
        }
    }
}
</script>
